package yscmd

import (
	"context"
	"github.com/gogf/gf/v2/os/gcmd"
)

type FlagSkipBuilder struct {
	FlagBuilderCore
}

func (b *FlagSkipBuilder) Init(ctx context.Context, group ...string) {
	b.FlagBuilderCore.Init(ctx)
	b.F.Short = ""
	b.F.Long = "skip"
	b.F.DefaultValue = false
	b.F.Description = `
        跳过等待`
}

func FlagSkip(ctx context.Context) *Flag {
	b := FlagSkipBuilder{}
	b.Init(ctx)
	return b.Flag()
}

func CmdWait(ctx context.Context) {
	if FlagSkip(ctx).Has() {
		return
	}
	gcmd.Scan("点击回车键继续...")
}
